import request from "@/utils/request";

export function getTaskInfo(params) {
  return request({
    url: "/task/list",
    method: "get",
    params
  });
}

export function updateTask(data) {
  return request({
    url: '/taskUpdate',
    method: 'post',
    data
  })
}

export function deleteTask(data) {
  return request({
    url: '/taskDelete',
    method: 'post',
    data
  })
}

export function startTask(taskId) {
  return request({
    url: "/manage_task/start_task",
    method: "get",
    params: {
      taskId: taskId
    }
  });
}

//1、查询当日测试任务信息
export function getTaskByDay(date) {
  return request({
    url: "/task/day",
    method: "get",
    params: {
      date
    }
  });
}

//2、查询当月测试任务信息
export function getTaskByMonth(date) {
  return request({
    url: "/task/month",
    method: "get",
    params: {
      date
    }
  });
}
//3、定义任务信息
export function defineTask(data) {
  return request({
    url: '/task',
    method: 'post',
    data
  })
}

//4、获取文件资源列表
export function getDataSet(dataSetName) {
  return request({
    url: "/dataSet",
    method: "get",
    params: {
      dataSetName
    }
  });
}

//5、预置参数列表及下拉框
export function getParamList() {
  return request({
    url: "arrange_task/param_list",
    method: "get",
  });
}


//6、预置参数查询（下拉框填入）
export function getParamSel(paramId) {
  return request({
    url: "arrange_task/param_sel",
    method: "get",
    params: {
      paramId
    }
  });
}



